package in.careerscale.apps.ocms.dao.model;

// Generated Jul 7, 2013 10:49:55 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Address generated by hbm2java
 */
@Entity
@Table(name = "address", catalog = "ocms")
public class Address implements java.io.Serializable {

	private Integer id;
	private City city;
	private String addressLine1;
	private String addressLine2;
	private String zipCode;
	private Set caseMasters = new HashSet(0);
	private Set userProfiles = new HashSet(0);

	public Address() {
	}

	public Address(City city, String addressLine1) {
		this.city = city;
		this.addressLine1 = addressLine1;
	}

	public Address(City city, String addressLine1, String addressLine2,
			String zipCode, Set caseMasters, Set userProfiles) {
		this.city = city;
		this.addressLine1 = addressLine1;
		this.addressLine2 = addressLine2;
		this.zipCode = zipCode;
		this.caseMasters = caseMasters;
		this.userProfiles = userProfiles;
	}

	public Address(int id, City city, String addressLine1, String zipCode)
	{
		this.id = id;
		this.city = city;
		this.addressLine1 = addressLine1;
		this.zipCode = zipCode;
	}

	public Address(City city, String addressLine1, String addressLine2, String zipCode)
	{

		this.city = city;
		this.addressLine1 = addressLine1;
		this.addressLine2 = addressLine2;
		this.zipCode = zipCode;
	}

	public Address(String addressLine1, String addressLine2, String zipCode)
	{

		this.addressLine1 = addressLine1;
		this.addressLine2 = addressLine2;
		this.zipCode = zipCode;
	}

	public Address(int id, City city, String addressLine1, String addressLine2, String zipCode,
			Set<CaseMaster> caseMasters)
	{
		this.id = id;
		this.city = city;
		this.addressLine1 = addressLine1;
		this.addressLine2 = addressLine2;
		this.zipCode = zipCode;
		this.caseMasters = caseMasters;
	}

	
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "city_id", nullable = false)
	public City getCity() {
		return this.city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	@Column(name = "address_line1", nullable = false, length = 150)
	public String getAddressLine1() {
		return this.addressLine1;
	}

	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}

	@Column(name = "address_line2", length = 45)
	public String getAddressLine2() {
		return this.addressLine2;
	}

	public void setAddressLine2(String addressLine2) {
		this.addressLine2 = addressLine2;
	}

	@Column(name = "zip_code", length = 20)
	public String getZipCode() {
		return this.zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
	public Set<CaseMaster> getCaseMasters()
	{
		return this.caseMasters;
	}

	public void setCaseMasters(Set<CaseMaster> caseMasters)
	{
		this.caseMasters = caseMasters;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
	public Set<UserProfile> getUserProfiles()
	{
		return this.userProfiles;
	}

	public void setUserProfiles(Set<UserProfile> userProfiles)
	{
		this.userProfiles = userProfiles;
	}

}
